package com.taxi.comm.business.service.M002;

import java.io.IOException;
import java.io.StringReader;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

import com.taxi.comm.message.Request;




public class M002Request extends Request {

	public String  SBHM;
	public String  CPH;
	public String  YYZH;
	public String  ZYZH;
	public String  SJXM;
	public String  CZGS;
	public String  BHDDWD;
	public String  BHDDJD;
	public String  BHSJ;
	public String  BHQZT;
	public String  BHHZT;
	public String  BZ;

	public void init(String xml) throws Exception{
		
		StringReader sr = new StringReader(xml);
	
		InputSource is = new InputSource(sr);
		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		DocumentBuilder builder = factory.newDocumentBuilder();
		Document doc = builder.parse(is);
		NodeList nl = doc.getElementsByTagName("SHCZ");
		
		Node node = nl.item(0);
		NamedNodeMap m1=node.getAttributes();
	    Node nodeAttri=m1.item(0);
	
		this.Ver=nodeAttri.getNodeValue();
		NodeList childNodes = node.getChildNodes();
		Node childNode = childNodes.item(0);
		NodeList childs = childNode.getChildNodes();
	
		for (int j = 0; j < childs.getLength(); j++) {

			Node child = childs.item(j);
			if (child.getNodeName().equals("BWLS")) {
				this.BWLS = child.getFirstChild().getNodeValue();
			
			}
			if (child.getNodeName().equals("BWLX")) {
				this.BWLX = child.getFirstChild().getNodeValue();
			
			}
			if (child.getNodeName().equals("QQBZ")) {
				this.QQBZ = child.getFirstChild().getNodeValue();
			
			}
			if (child.getNodeName().equals("YDDM")) {
				this.YDDM = child.getFirstChild().getNodeValue();
			
			}
			if (child.getNodeName().equals("FSF")) {
				this.FSF = child.getFirstChild().getNodeValue();
			
			}
			if (child.getNodeName().equals("JSF")) {
				this.JSF = child.getFirstChild().getNodeValue();
			
			}
			if (child.getNodeName().equals("SCSJ")) {
				this.SCSJ = child.getFirstChild().getNodeValue();
			
			}
			if (child.getNodeName().equals("BWXH")) {
				this.BWXH = child.getFirstChild().getNodeValue();
			
			}
			if (child.getNodeName().equals("XTMC")) {
				this.XTMC = child.getFirstChild().getNodeValue();
			
			}
            
			if (child.getNodeName().equals("SBHM")) {
				this.SBHM = child.getFirstChild().getNodeValue();
			
			}
		}
		childNode = childNodes.item(1);
		NodeList childs2 = childNode.getChildNodes();
		
		for (int k = 0; k < childs2.getLength(); k++) {

			Node child2 = childs2.item(k);
			
			if (child2.getNodeName().equals("CPH")) {
				this.CPH = child2.getFirstChild().getNodeValue();
			
			}
            if (child2.getNodeName().equals("YYZH")) {
            	this.YYZH = child2.getFirstChild().getNodeValue();
			
			}
			if (child2.getNodeName().equals("ZYZH")) {
				this.ZYZH = child2.getFirstChild().getNodeValue();
			
			}
			if (child2.getNodeName().equals("SJXM")) {
				this.SJXM = child2.getFirstChild().getNodeValue();
			
			}
			if (child2.getNodeName().equals("CZGS")) {
				this.CZGS = child2.getFirstChild().getNodeValue();
			
			}
			
			
			
			if (child2.getNodeName().equals("BHDDWD")) {
				this.BHDDWD = child2.getFirstChild().getNodeValue();
			
			}
			if (child2.getNodeName().equals("BHDDJD")) {
				this.BHDDJD = child2.getFirstChild().getNodeValue();
			
			}
			if (child2.getNodeName().equals("BHSJ")) {
				this.BHSJ = child2.getFirstChild().getNodeValue();
			
			}
			if (child2.getNodeName().equals("BHQZT")) {
				this.BHQZT = child2.getFirstChild().getNodeValue();
			
			}
			if (child2.getNodeName().equals("BHHZT")) {
				this.BHHZT = child2.getFirstChild().getNodeValue();
			
			}
			if (child2.getNodeName().equals("BZ")) {
				this.BZ = child2.getFirstChild().getNodeValue();
			
			}


		}
		
	}

}
